<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  //可以使用短路运算符来进行赋值
  let sex=prompt("请输入性别：")|| "保密";
  console.log(sex);

  function star(num){
    document.write("*".repeat(num || 5));
  };

  star()
  
</script>
</html>